#include "WeaponSystems.h"

WeaponSystem::WeaponSystem()
	:PhysicsBox()
{
	MaxAmmo = 0;
	CurrentAmmo = MaxAmmo;
	Time = 0;
	FireRate = 0;
	LastShot = 0;
	ReloadTime = -1;
}

WeaponSystem::WeaponSystem(IDirect3DDevice9 *nDevice, D3DXVECTOR3 nPosition, D3DXVECTOR3 nVelocity, int nMaxAmmo, float nFireRate, float nReloadTime)
	: PhysicsBox(nDevice, nPosition, nVelocity)
{
	MaxAmmo = nMaxAmmo;
	CurrentAmmo = MaxAmmo;
	Time = 0;
	FireRate = nFireRate;
	LastShot = 0;
	ReloadTime = nReloadTime;
}

WeaponSystem::~WeaponSystem()
{
	
}

void WeaponSystem::Update( float dt )
{
	PhysicsBox::Update(dt);
}

void WeaponSystem::Render( void )
{
	PhysicsBox::Render();
}



MissilePod::MissilePod() : WeaponSystem()
{

};

MissilePod::MissilePod(IDirect3DDevice9 *nDevice, D3DXVECTOR3 nPosition, D3DXVECTOR3 nVelocity, int MaxAmmo, float nFireRate, float nReloadTime)
	:WeaponSystem(nDevice, nPosition, nVelocity, MaxAmmo, nFireRate, nReloadTime)
{
	Missiles.reserve(MaxAmmo);
}

MissilePod::~MissilePod()
{

}

void MissilePod::Reload( void )
{
	for(unsigned int i = 0; i < Missiles.size(); ++i)
	{
		Missiles[i].SetPosition(Position);
		Missiles[i].SetVelocity(D3DXVECTOR3(0,0,0));
	}
}
void MissilePod::Fire( void )
{

}

void MissilePod::Update( float dt )
{

}

void MissilePod::Render( void )
{

}